package edu.sjtu.context.prob;

import edu.sjtu.context.core.RemoteContextChangeListener;

/**
 * Interface of remote context probes. Each remote probe must implement this interface.
 * The probe will be initialized by {@link ContextManager}, the ContextManager will 
 * create a Thread for each remote prob.
 * 
 * @author Roger
 *
 */
public interface RemoteContextProb extends Runnable {
	/**
	 * Add remote context change listener to the probe.
	 * @param lis
	 * 		listener to be added.
	 */
	public void addRemoteContextChangeListener(RemoteContextChangeListener lis);
	
	/**
	 * remove remote context change listener from the probe.
	 * @param lis
	 * 		listener to be removed.
	 * @return
	 * 		the index of the listener which will be removed in the probe's listener list. 
	 */
	public int removeRemoteContextChangeListener(RemoteContextChangeListener lis);
	
	/**
	 * Get the name of the ontology which a specific Remote Probe apply on.
	 * @return
	 * 	The name of the ontology which a specific Remote Probe apply on.
	 */
	public String getOntName();
	
	/**
	 * Set the name of the ontology which a specific remote probe apply on.
	 * @param ontName
	 * 		the name of the ontology.
	 * @return
	 */
	public void setOntName(String ontName);
	
	/**
	 * set the topic which will be subscribed
	 * @param topic
	 */
	public void setSubscribeTopic(String topic);
	
	/**
	 * set the connection string used to connect to remote message broker.
	 * @param connUrl
	 */
	public void setConnUrl(String connUrl);
}
